package com.engine.plugin.annual.cmd;

import com.engine.annual.cmd.AnnualDelCmd;
import com.engine.core.cfg.annotation.CommandDynamicProxy;
import com.engine.core.interceptor.AbstractCommandProxy;
import com.engine.core.interceptor.Command;

import java.util.Map;

@CommandDynamicProxy(target = AnnualDelCmd.class, desc = "功能描述")
public class AnnualDelInfoCmd extends AbstractCommandProxy<Map<String, Object>> {
    @Override
    public Map<String, Object> execute(Command<Map<String, Object>> command) {

        System.out.println(getClass().getName() + "command 执行之前做一些事");

        AnnualDelCmd annualDelCmd = (AnnualDelCmd) command;
        Map<String, Object> params = annualDelCmd.getParams();
        //对参数进行预处理
        //TODO
        //把参数放回
        annualDelCmd.setParams(params);

        Map<String, Object> result = nextExecute(command);

        System.out.println(getClass().getName() + "command 执行之后做一些事情");

        result.put("a", "b");

        return result;
    }
}
